public class Solution2224 {
    public int convertTime(String current, String correct) {
        int h1=Integer.parseInt(current.substring(0,2));
        int h2=Integer.parseInt(correct.substring(0,2));
        int m1=Integer.parseInt(current.substring(3));
        int m2=Integer.parseInt(correct.substring(3));
        int time=(h2-h1)*60+(m2-m1);
        int ans=time/60;
        time%=60;
        ans+=time/15;
        time%=15;
        ans+=time/5;
        time%=5;
        ans+=time;
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(new Solution2224().convertTime("02:30","04:35"));
    }
}
